// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class DetectorRead
{
	/// <summary>
	/// <para>
	/// The field used to split the data.
	/// In particular, this property is used for analyzing the splits with respect to their own history.
	/// It is used for finding unusual values in the context of the split.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("by_field_name")]
	public string? ByFieldName { get; init; }

	/// <summary>
	/// <para>
	/// An array of custom rule objects, which enable you to customize the way detectors operate.
	/// For example, a rule may dictate to the detector conditions under which results should be skipped.
	/// Kibana refers to custom rules as job rules.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("custom_rules")]
	public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Serverless.MachineLearning.DetectionRule>? CustomRules { get; init; }

	/// <summary>
	/// <para>
	/// A description of the detector.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("detector_description")]
	public string? DetectorDescription { get; init; }

	/// <summary>
	/// <para>
	/// A unique identifier for the detector.
	/// This identifier is based on the order of the detectors in the <c>analysis_config</c>, starting at zero.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("detector_index")]
	public int? DetectorIndex { get; init; }

	/// <summary>
	/// <para>
	/// Contains one of the following values: <c>all</c>, <c>none</c>, <c>by</c>, or <c>over</c>.
	/// If set, frequent entities are excluded from influencing the anomaly results.
	/// Entities can be considered frequent over time or frequent in a population.
	/// If you are working with both over and by fields, then you can set <c>exclude_frequent</c> to all for both fields, or to <c>by</c> or <c>over</c> for those specific fields.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("exclude_frequent")]
	public Elastic.Clients.Elasticsearch.Serverless.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; init; }

	/// <summary>
	/// <para>
	/// The field that the detector uses in the function.
	/// If you use an event rate function such as <c>count</c> or <c>rare</c>, do not specify this field.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("field_name")]
	public string? FieldName { get; init; }

	/// <summary>
	/// <para>
	/// The analysis function that is used.
	/// For example, <c>count</c>, <c>rare</c>, <c>mean</c>, <c>min</c>, <c>max</c>, and <c>sum</c>.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("function")]
	public string Function { get; init; }

	/// <summary>
	/// <para>
	/// The field used to split the data.
	/// In particular, this property is used for analyzing the splits with respect to the history of all splits.
	/// It is used for finding unusual values in the population of all splits.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("over_field_name")]
	public string? OverFieldName { get; init; }

	/// <summary>
	/// <para>
	/// The field used to segment the analysis.
	/// When you use this property, you have completely independent baselines for each value of this field.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("partition_field_name")]
	public string? PartitionFieldName { get; init; }

	/// <summary>
	/// <para>
	/// Defines whether a new series is used as the null series when there is no value for the by or partition fields.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("use_null")]
	public bool? UseNull { get; init; }
}